package TestXunuan;

public class TestFor {
    public static void main(String[] args) {
        //求1!+2!+3!+...+10!
        int sum=0;
        for (int i=1;i<=10;i++){
            int n=1;
            for (int j=1;j<=i;j++){
                n=n*j;
            }
            sum=sum+n;
        }
        System.out.println(sum);

        //求1-5的累加和
        int num=0;
        for (int n=1;n<=5;n++){
            num=num+n;
        }
        System.out.println(num);
    }
}
